//
//  LiveCell.swift
//  Swift_MyLive
//
//  Created by admin on 16/9/8.
//  Copyright © 2016年 admin. All rights reserved.
//

import UIKit

class LiveCell: UICollectionViewCell {
    
    var imgV:UIImageView?
    var title:UILabel?
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
//        self.backgroundColor = UIColor.redColor()
        
         imgV = UIImageView(frame: CGRect(x: 10, y: 10, width: WIDTH/2-20, height: 90))
        imgV!.layer.cornerRadius = 10
        imgV!.clipsToBounds = true
        self.contentView.addSubview(imgV!)
        
        let titleY = imgV!.frame.maxY
        title = UILabel(frame: CGRect(x: 10, y: titleY, width: WIDTH/2-20, height: 40))
        title!.font = UIFont.systemFont(ofSize: 12)
        title?.numberOfLines = 0
        self.contentView.addSubview(title!)
    }
    
    func setCellData(dataM:DataModel)
    {
        imgV?.loadImgUrl(imgUrl: dataM.imgUrl)
        
        title!.text = dataM.title
    }
    

    
}
